using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models;
using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models.Attributes;
using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models.Attributes.DomainAttributes;
using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models.Enums;
using System.Collections.Generic;
using System.ComponentModel;

namespace Baci.ArcGIS._SpatialAnalystTools._Multivariate
{
    /// <summary>
    /// <para>Maximum Likelihood Classification</para>
    /// <para>Performs a maximum likelihood classification on a set of raster bands and creates a classified raster as output.</para>
    /// <para>对一组栅格波段执行最大似然分类，并创建分类栅格作为输出。</para>
    /// </summary>    
    [DisplayName("Maximum Likelihood Classification")]
    public class MLClassify : AbstractGPProcess
    {
        /// <summary>
        /// 无参构造
        /// </summary>
        public MLClassify()
        {

        }

        /// <summary>
        /// 有参构造
        /// </summary>
        /// <param name="_in_raster_bands">
        /// <para>Input raster bands</para>
        /// <para><xdoc>
        ///   <para>The input raster bands.</para>
        ///   <para>While the bands can be integer or floating point type, the signature file only allows integer class values.</para>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>输入栅格波段。</para>
        ///   <para>虽然条带可以是整数或浮点类型，但特征文件只允许整数类值。</para>
        /// </xdoc></para>
        /// </param>
        /// <param name="_in_signature_file">
        /// <para>Input signature file</para>
        /// <para><xdoc>
        ///   <para>The input signature file whose class signatures are used by the maximum likelihood classifier.</para>
        ///   <para>A .gsg extension is required.</para>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>最大似然分类器使用其类签名的输入特征文件。</para>
        ///   <para>需要 .gsg 扩展名。</para>
        /// </xdoc></para>
        /// </param>
        /// <param name="_out_classified_raster">
        /// <para>Output classified raster</para>
        /// <para><xdoc>
        ///   <para>The output classified raster.</para>
        ///   <para>It will be of integer type.</para>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>输出分类栅格。</para>
        ///   <para>它将是整数类型。</para>
        /// </xdoc></para>
        /// </param>
        public MLClassify(List<object> _in_raster_bands, object _in_signature_file, object _out_classified_raster)
        {
            this._in_raster_bands = _in_raster_bands;
            this._in_signature_file = _in_signature_file;
            this._out_classified_raster = _out_classified_raster;
        }
        public override string ToolboxName => "Spatial Analyst Tools";

        public override string ToolName => "Maximum Likelihood Classification";

        public override string CallName => "sa.MLClassify";

        public override List<string> AcceptEnvironments => ["autoCommit", "cellSize", "cellSizeProjectionMethod", "compression", "configKeyword", "extent", "geographicTransformations", "mask", "outputCoordinateSystem", "scratchWorkspace", "snapRaster", "tileSize", "workspace"];

        public override object[] ParameterInfo => [_in_raster_bands, _in_signature_file, _out_classified_raster, _reject_fraction.GetGPValue(), _a_priori_probabilities.GetGPValue(), _in_a_priori_file, _out_confidence_raster];

        /// <summary>
        /// <para>Input raster bands</para>
        /// <para><xdoc>
        ///   <para>The input raster bands.</para>
        ///   <para>While the bands can be integer or floating point type, the signature file only allows integer class values.</para>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>输入栅格波段。</para>
        ///   <para>虽然条带可以是整数或浮点类型，但特征文件只允许整数类值。</para>
        /// </xdoc></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Input raster bands")]
        [Description("")]
        [Option(OptionTypeEnum.Must)]
        public List<object> _in_raster_bands { get; set; }


        /// <summary>
        /// <para>Input signature file</para>
        /// <para><xdoc>
        ///   <para>The input signature file whose class signatures are used by the maximum likelihood classifier.</para>
        ///   <para>A .gsg extension is required.</para>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>最大似然分类器使用其类签名的输入特征文件。</para>
        ///   <para>需要 .gsg 扩展名。</para>
        /// </xdoc></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Input signature file")]
        [Description("")]
        [Option(OptionTypeEnum.Must)]
        public object _in_signature_file { get; set; }


        /// <summary>
        /// <para>Output classified raster</para>
        /// <para><xdoc>
        ///   <para>The output classified raster.</para>
        ///   <para>It will be of integer type.</para>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>输出分类栅格。</para>
        ///   <para>它将是整数类型。</para>
        /// </xdoc></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Output classified raster")]
        [Description("")]
        [Option(OptionTypeEnum.Must)]
        public object _out_classified_raster { get; set; }


        /// <summary>
        /// <para>Reject fraction</para>
        /// <para><xdoc>
        ///   <para>Select a reject fraction, which determines whether a cell will be classified based on its likelihood of being correctly assigned to one of the classes. Cells whose likelihood of being correctly assigned to any of the classes is lower than the reject fraction will be given a value of NoData in the output classified raster.</para>
        ///   <para>The default value is 0.0, which means that every cell will be classified.</para>
        ///   <para>Valid entries are:</para>
        ///   <bulletList>
        ///     <bullet_item>0.0</bullet_item><para/>
        ///     <bullet_item>0.005</bullet_item><para/>
        ///     <bullet_item>0.01</bullet_item><para/>
        ///     <bullet_item>0.025</bullet_item><para/>
        ///     <bullet_item>0.05</bullet_item><para/>
        ///     <bullet_item>0.1</bullet_item><para/>
        ///     <bullet_item>0.25</bullet_item><para/>
        ///     <bullet_item>0.5</bullet_item><para/>
        ///     <bullet_item>0.75</bullet_item><para/>
        ///     <bullet_item>0.9</bullet_item><para/>
        ///     <bullet_item>0.95</bullet_item><para/>
        ///     <bullet_item>0.975</bullet_item><para/>
        ///     <bullet_item>0.99</bullet_item><para/>
        ///     <bullet_item>0.995</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>选择拒绝分数，该分数确定是否根据单元格被正确分配给其中一个类的可能性对单元格进行分类。如果像元被正确分配给任何类的可能性低于拒绝分数，则将在输出分类栅格中为其提供 NoData 值。</para>
        ///   <para>默认值为 0.0，这意味着将对每个单元格进行分类。</para>
        ///   <para>有效条目为：</para>
        ///   <bulletList>
        ///     <bullet_item>0.0</bullet_item><para/>
        ///     <bullet_item>0.005</bullet_item><para/>
        ///     <bullet_item>0.01</bullet_item><para/>
        ///     <bullet_item>0.025</bullet_item><para/>
        ///     <bullet_item>0.05</bullet_item><para/>
        ///     <bullet_item>0.1</bullet_item><para/>
        ///     <bullet_item>0.25</bullet_item><para/>
        ///     <bullet_item>0.5</bullet_item><para/>
        ///     <bullet_item>0.75</bullet_item><para/>
        ///     <bullet_item>0.9</bullet_item><para/>
        ///     <bullet_item>0.95</bullet_item><para/>
        ///     <bullet_item>0.975</bullet_item><para/>
        ///     <bullet_item>0.99</bullet_item><para/>
        ///     <bullet_item>0.995</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Reject fraction")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public _reject_fraction_value _reject_fraction { get; set; } = _reject_fraction_value.value0;

        public enum _reject_fraction_value
        {
            /// <summary>
            /// <para>0.0</para>
            /// <para>0.0</para>
            /// <para>0.0</para>
            /// </summary>
            [Description("0.0")]
            [GPEnumValue("0.0")]
            value0,

            /// <summary>
            /// <para>0.005</para>
            /// <para>0.005</para>
            /// <para>0.005</para>
            /// </summary>
            [Description("0.005")]
            [GPEnumValue("0.005")]
            value1,

            /// <summary>
            /// <para>0.01</para>
            /// <para>0.01</para>
            /// <para>0.01</para>
            /// </summary>
            [Description("0.01")]
            [GPEnumValue("0.01")]
            value2,

            /// <summary>
            /// <para>0.025</para>
            /// <para>0.025</para>
            /// <para>0.025</para>
            /// </summary>
            [Description("0.025")]
            [GPEnumValue("0.025")]
            value3,

            /// <summary>
            /// <para>0.05</para>
            /// <para>0.05</para>
            /// <para>0.05</para>
            /// </summary>
            [Description("0.05")]
            [GPEnumValue("0.05")]
            value4,

            /// <summary>
            /// <para>0.1</para>
            /// <para>0.1</para>
            /// <para>0.1</para>
            /// </summary>
            [Description("0.1")]
            [GPEnumValue("0.1")]
            value5,

            /// <summary>
            /// <para>0.25</para>
            /// <para>0.25</para>
            /// <para>0.25</para>
            /// </summary>
            [Description("0.25")]
            [GPEnumValue("0.25")]
            value6,

            /// <summary>
            /// <para>0.5</para>
            /// <para>0.5</para>
            /// <para>0.5</para>
            /// </summary>
            [Description("0.5")]
            [GPEnumValue("0.5")]
            value7,

            /// <summary>
            /// <para>0.75</para>
            /// <para>0.75</para>
            /// <para>0.75</para>
            /// </summary>
            [Description("0.75")]
            [GPEnumValue("0.75")]
            value8,

            /// <summary>
            /// <para>0.9</para>
            /// <para>0.9</para>
            /// <para>0.9</para>
            /// </summary>
            [Description("0.9")]
            [GPEnumValue("0.9")]
            value9,

            /// <summary>
            /// <para>0.95</para>
            /// <para>0.95</para>
            /// <para>0.95</para>
            /// </summary>
            [Description("0.95")]
            [GPEnumValue("0.95")]
            value10,

            /// <summary>
            /// <para>0.975</para>
            /// <para>0.975</para>
            /// <para>0.975</para>
            /// </summary>
            [Description("0.975")]
            [GPEnumValue("0.975")]
            value11,

            /// <summary>
            /// <para>0.99</para>
            /// <para>0.99</para>
            /// <para>0.99</para>
            /// </summary>
            [Description("0.99")]
            [GPEnumValue("0.99")]
            value12,

            /// <summary>
            /// <para>0.995</para>
            /// <para>0.995</para>
            /// <para>0.995</para>
            /// </summary>
            [Description("0.995")]
            [GPEnumValue("0.995")]
            value13,

        }

        /// <summary>
        /// <para>A priori probability weighting</para>
        /// <para><xdoc>
        ///   <para>Specifies how a priori probabilities will be determined.</para>
        ///   <bulletList>
        ///     <bullet_item>Equal— All classes will have the same a priori probability.</bullet_item><para/>
        ///     <bullet_item>Sample— A priori probabilities will be proportional to the number of cells in each class relative to the total number of cells sampled in all classes in the signature file.</bullet_item><para/>
        ///     <bullet_item>File—The a priori probabilities will be assigned to each class from an input ASCII a priori probability file.</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>指定如何确定先验概率。</para>
        ///   <bulletList>
        ///     <bullet_item>相等 - 所有类将具有相同的先验概率。</bullet_item><para/>
        ///     <bullet_item>样本 — 先验概率将与每个类中的像元数相对于签名文件中所有类中采样的像元总数成正比。</bullet_item><para/>
        ///     <bullet_item>文件 - 先验概率将从输入 ASCII 先验概率文件分配给每个类。</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// <para></para>
        /// </summary>
        [DisplayName("A priori probability weighting")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public _a_priori_probabilities_value _a_priori_probabilities { get; set; } = _a_priori_probabilities_value._EQUAL;

        public enum _a_priori_probabilities_value
        {
            /// <summary>
            /// <para>Equal</para>
            /// <para>Equal— All classes will have the same a priori probability.</para>
            /// <para>相等 - 所有类将具有相同的先验概率。</para>
            /// </summary>
            [Description("Equal")]
            [GPEnumValue("EQUAL")]
            _EQUAL,

            /// <summary>
            /// <para>Sample</para>
            /// <para>Sample— A priori probabilities will be proportional to the number of cells in each class relative to the total number of cells sampled in all classes in the signature file.</para>
            /// <para>样本 — 先验概率将与每个类中的像元数相对于签名文件中所有类中采样的像元总数成正比。</para>
            /// </summary>
            [Description("Sample")]
            [GPEnumValue("SAMPLE")]
            _SAMPLE,

            /// <summary>
            /// <para>File</para>
            /// <para>File—The a priori probabilities will be assigned to each class from an input ASCII a priori probability file.</para>
            /// <para>文件 - 先验概率将从输入 ASCII 先验概率文件分配给每个类。</para>
            /// </summary>
            [Description("File")]
            [GPEnumValue("FILE")]
            _FILE,

        }

        /// <summary>
        /// <para>Input a priori probability file</para>
        /// <para><xdoc>
        ///   <para>A text file containing a priori probabilities for the input signature classes.</para>
        ///   <para>An input for the a priori probability file is only required when the File option is used.</para>
        ///   <para>The extension for the a priori file can be .txt or .asc.</para>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>包含输入签名类的先验概率的文本文件。</para>
        ///   <para>仅当使用 File 选项时，才需要先验概率文件的输入。</para>
        ///   <para>先验文件的扩展名可以是 .txt 或 .asc。</para>
        /// </xdoc></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Input a priori probability file")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public object _in_a_priori_file { get; set; } = null;


        /// <summary>
        /// <para>Output confidence raster</para>
        /// <para><xdoc>
        ///   <para>The output confidence raster dataset shows the certainty of the classification in 14 levels of confidence, with the lowest values representing the highest reliability. If there are no cells classified at a particular confidence level, that confidence level will not be present in the output confidence raster.</para>
        ///   <para>It will be of integer type.</para>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>输出置信度栅格数据集在 14 个置信度中显示分类的确定性，最低值表示最高可靠性。如果没有按特定置信水平分类的像元，则输出置信度栅格中将不存在该置信水平。</para>
        ///   <para>它将是整数类型。</para>
        /// </xdoc></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Output confidence raster")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public object _out_confidence_raster { get; set; } = null;


        public MLClassify SetEnv(int? autoCommit = null, object cellSize = null, object compression = null, object configKeyword = null, object extent = null, object geographicTransformations = null, object mask = null, object outputCoordinateSystem = null, object scratchWorkspace = null, object snapRaster = null, double[] tileSize = null, object workspace = null)
        {
            base.SetEnv(autoCommit: autoCommit, cellSize: cellSize, compression: compression, configKeyword: configKeyword, extent: extent, geographicTransformations: geographicTransformations, mask: mask, outputCoordinateSystem: outputCoordinateSystem, scratchWorkspace: scratchWorkspace, snapRaster: snapRaster, tileSize: tileSize, workspace: workspace);
            return this;
        }

    }

}